# Maintainer: David Runge <dave@sleepmap.de>
pkgname=dgedit
pkgver=0.10.0
pkgrel=2
pkgdesc="The DrumGizmo drumkit editor"
arch=('loong64' 'x86_64')
url="https://drumgizmo.org/wiki/doku.php?id=getting_dgedit"
license=('GPL3')
groups=('pro-audio')
depends=('hicolor-icon-theme' 'libao' 'libsndfile' 'qt5-base')
makedepends=('qt5-tools')
source=("https://drumgizmo.org/releases/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz"{,.asc})
sha512sums=('507570d43a2dfc572f7c4bec9ae1d5a85eb947247022f8ab84776284affebc5845e22d5c03cc975ffe3ca636a9eab91888cfd33c802f07dd6b5eb42668656cb6'
            'SKIP')
validpgpkeys=('F39C94D556CCB995B1AE540E9EB89445BF071867') # DrumGizmo <info@drumgizmo.org>

prepare() {
  cd "$pkgname-$pkgver"
  autoreconf -vfi
}

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr
  make
}

check() {
  cd "$pkgname-$pkgver"
  make -k check
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install
  install -vDm 644 "${pkgname}.desktop" \
    -t "${pkgdir}/usr/share/applications/"
  install -vDm 644 "icons/${pkgname}.svg" \
    -t "${pkgdir}/usr/share/icons/hicolor/scalable/apps/dgedit/"
  install -vDm 644 {AUTHORS,} \
    -t "${pkgdir}/usr/share/doc/${pkgname}"
}
